<?php
header("content-type:text/html;charset=utf8");
$name=$_GET['username'];
$pwd=$_GET['userpwd'];
$addtime =date('Y-m-d H:i:s',time());
$dbh  = new  PDO ( 'mysql:host=localhost;dbname=mhsw' , 'root' , 'root' );
$sql="insert into jj (username,userpwd,addtime) VALUES('$name','$pwd','$addtime')";
$sqldo=$dbh->exec($sql);
if($sqldo)
{
    header('location:list.php');
}
else{
    echo "添加失败";
}